using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace RiceShop.Models
{
  /// <summary>
  /// 商品分类实体类
  /// </summary>
  [Table("Category")]
  public class Category
  {
    /// <summary>
    /// 分类ID
    /// </summary>
    [Key]
    [Column("id")]
    public long Id { get; set; }

    /// <summary>
    /// 父分类ID
    /// </summary>
    [Column("parentId")]
    public long? ParentId { get; set; }

    /// <summary>
    /// 分类名称
    /// </summary>
    [StringLength(50)]
    [Column("name")]
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 分类图标
    /// </summary>
    [StringLength(500)]
    [Column("icon")]
    public string? Icon { get; set; }

    /// <summary>
    /// 排序号
    /// </summary>
    [Column("sort")]
    public int Sort { get; set; }

    /// <summary>
    /// 层级
    /// </summary>
    [Column("level")]
    public string? Level { get; set; } = string.Empty;

    /// <summary>
    /// 是否删除
    /// </summary>
    [Column("isDeleted")]
    public bool IsDeleted { get; set; } = false;

    /// <summary> 
    /// 创建时间 
    /// </summary> 
    [Column("createTime")]
    public DateTime CreateTime { get; set; } = DateTime.Now;
    /// <summary> 
    /// 更新时间 
    /// </summary> 
    [Column("updateTime")]
    public DateTime UpdateTime { get; set; } = DateTime.Now;


  }
}